package com.quad.innovators.salesease.controller.warehouse;

import com.quad.innovators.salesease.annotation.DataPermission;
import com.quad.innovators.salesease.common.result.Result;
import com.quad.innovators.salesease.constants.SystemConstants;
import com.quad.innovators.salesease.model.vo.warehouse.ScanCodeVO;
import com.quad.innovators.salesease.service.warehouse.ReturnOrderDetailService;
import com.quad.innovators.salesease.service.warehouse.SaleOrderDetailService;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.Parameters;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;

/**
 * @author : shanshan.li
 * @createTime : 2025/2/10 10:08
 * @Version : 1.0 
 */
@Tag(name = "14.退货单详情")
@RestController
@RequestMapping(SystemConstants.BACKEND_API + "/return-order-detail")
@RequiredArgsConstructor
public class ReturnOrderDetailController {

    private final ReturnOrderDetailService returnOrderDetailService;

    @Operation(summary = "表单数据")
    @GetMapping("/{code}/getScanDetail")
    @Parameters({
            @Parameter(name = "code", description = "code"),
    })
    @DataPermission(permissionCode = "warehouse:sale-return-order:data-permission")
    public Result<List<ScanCodeVO>> getScanDetail(@PathVariable("code") String returnOrderDetailCode) {
        List<ScanCodeVO> scanCodeVOList  = returnOrderDetailService.getScanDetail(returnOrderDetailCode);
        return Result.success(scanCodeVOList);
    }
}
